using System;
using System.Collections.Generic;
using System.Text;
using HeThongDAO;
using System.Data;
using System.Data.OleDb;
using DTO;

namespace HeThongBUS
{
    public class KhachHangBUS
    {
        public static DataTable LayTatCaKhachHang()
        {
            return HeThongDAO.KhachHangDAO.SelectAll();
        }
        public static DataTable ChonKhachHang(KhachHangDTO kh)
        {
            return KhachHangDAO.ChonKhachHang(kh);
        }
        public static bool Update(DataTable dt)
        {
            return HeThongDAO.KhachHangDAO.Update(dt);
        }

        // Xuan Huy
        public static bool CapNhatKhachHang(KhachHangDTO khDTO)
        {
            // Kiem tra du lieu nhap


            if (!KhachHangDAO.CapNhatKhachHang(khDTO))
                return false;
            return true;
        }
        public static void CapNhat_NoKhachHang(KhachHangDTO kh)
        {
            KhachHangDAO.CapNhat_NoKhachHang(kh);
        }
        public static DataTable LayTongTraTuThang(KhachHangDTO kh, int thang, int nam)
        {
            return KhachHangDAO.LayTongTraTuThang(kh, thang, nam);
        }
        public static DataTable LayTongMuaTuThang(KhachHangDTO kh, int thang, int nam)
        {
            return KhachHangDAO.LayTongMuaTuThang(kh, thang, nam);
        }
        public static DataTable LayTongMuaTrongThang(KhachHangDTO kh, int thang, int nam)
        {
            return KhachHangDAO.LayTongMuaTrongThang(kh, thang, nam);
        }
        public static DataTable LayTongTraTrongThang(KhachHangDTO kh, int thang, int nam)
        {
            return KhachHangDAO.LayTongTraTrongThang(kh, thang, nam);
        }
    }
}
